{%extends "simple_base.html"%}
{%block header_blueprint_size%}15{%endblock%}
{%block header_right%}
<div class = "span-3">
        {% if user.is_authenticated %}
        Hello, {{user}}!<br><a href = "/cart/">Manage your cart</a>
        {%else%}Welcome, guest!{%endif%}
</div>
<div id = "top_userbar" class = "span-5 last right top">
{% if user.is_authenticated %}
    <form action = "/users/logout/" method = "post">
        {%csrf_token%}
        <button>Log out</button>
    </form>
{%else%}
    <form id = "welcome_auth_form" action = "/users/login/" method = "post">
        {%csrf_token%}
        {{auth_form.as_p}}
        <button class = "left">Log in</button>
    </form>
    <span class = "create_account">or <a href = "/users/create">Create an account</a></span>
{%endif%}
</div>
{%endblock%}

{%block body%}
<div class = "span-4 left">{%block left_col%}
    {%block left_col_top%}{%endblock%}
    {%for c in root_categories%}
    <div class = "category">
        <a href = "/categories/{{c.as_url}}">{{c.name}}</a>
    </div>
    {%endfor%}
    {%block left_col_admin%}
        {% if user.is_staff%}
        <hr>
        <div id = "nav_admin">
            <a href = "/admin/">Administration</a>
        </div>
        {%endif%}
    {%endblock%}
    {%block left_col_bottom%}{%endblock%}
{%endblock%}</div>
<div class = "span-20 last">{%block content%}{%endblock%}</div>
{%block bottom%}{%endblock%}
{%endblock%}
